import { divide } from 'lodash'

// 兑换券、卖品券详情
export const detailList = ctx => {
  return [
    { name: '产品名称', label: 'name' },
    { name: '业务类型', label: 'businessTypeName' },
    { name: '产品类型', label: 'typeName' },
    { name: '销售方式', label: '' },
    { name: '券名称', label: 'couponName' },
    { name: '产品面值(元)', label: 'parValue' },
    { name: '产品有效时间', label: '' },
    { name: '可用渠道', label: 'channelName' },
    { name: '兑换范围', label: 'exchangeRange' },
    { name: '产品可售部门', label: 'apartmentName' },
    {
      name: '解绑配置',
      render: (h) => {
        return [
          <span>{ctx.infoData.isUnbundling === '1' ? '可解绑' : '不可解绑'}</span>
        ]
      }
    },
    {
      name: '转赠配置',
      render: (h) => {
        return [
          <span>{ctx.infoData.isGive === '1' ? '可转赠' : '不可转赠'}</span>
        ]
      }
    },
    { name: '使用说明', label: 'usageRules' },
    { name: '备注', label: 'remark' }
  ]
}
// 优惠券详情
export const saleCoupon = ctx => {
  return [
    { name: '产品名称', label: 'name' },
    { name: '业务类型', label: 'businessTypeName' },
    { name: '产品类型', label: 'typeName' },
    { name: '销售方式', label: '' },
    { name: '券名称', label: 'couponName' },
    { name: '优惠面值', label: 'parValue' },
    { name: '可用渠道', label: 'channelName' },
    { name: '兑换范围', label: 'exchangeRange' },
    { name: '产品可售部门', label: 'apartmentName' },
    { name: '解绑配置', label: 'unBindName' },
    { name: '转赠配置', label: 'exchangeName' },
    {name: ''},
    { name: '使用说明', label: 'usageRules' },
    { name: '备注', label: 'remark' }
  ]
}
